import {fetch} from 'dva';

function checkStatus(response) {
    if (response.status >= 200 && response.status < 300) {
      return response;
    }
    const error = new Error(response.statusText);
    error.response = response;
    throw error;
  }

const baseUrl = 'http://101.200.43.125:8889';
export default async function request(url, options) {
    const response = await fetch(baseUrl + url, options);
    const data = await response.json();
    return data;
}